import oj from '/@/router/main/oj'
import tool from '/@/router/main/tool'

const router = {
  name: 'home',
  path: '/home',
  component: () => import('/@/views/index/index.vue'),
  redirect: '/home/index',
  children: [
    {
      name: 'index',
      path: 'index',
      component: () => import('/@/views/finance/RecordList.vue'),
      meta: {
        title: '首页消息',
        keepAlive: true,
      },
    },
    {
      path: 'task',
      name: 'Task',
      component: () => import('/@/views/task/index.vue')
    },
    {
      path: 'inter',
      name: 'Inter',
      component: () => import('/@/views/inter/index.vue')
    },
    {
      name: 'aigc',
      path: 'aigc',
      component: () => import('/@/views/aigc/index.vue'),
      meta: {
        title: 'chatbi',
        keepAlive: true,
      },
    },
    {
      name: 'chatbi',
      path: 'chatbi',
      component: () => import('/@/views/chatbi/index.vue'),
      meta: {
        title: '聊天机器人',
        keepAlive: true,
      },
    },
    {
      name: 'finance',
      path: 'finance',
      component: () => import('/@/views/finance/RecordList.vue'),
      meta: {
        title: '记账本',
        keepAlive: true,
      },
    },
    {
      name: 'blog',
      path: '/home/blog',
      component: () => import('/@/views/blog/index.vue'),
      children: [],
    },
    {
      name: 'blogArticle',
      path: '/home/blog/article/:id',
      component: () => import('/@/views/blog/article.vue'),
    },
    {
      name: 'blogWrite',
      path: '/home/blog/write',
      component: () => import('/@/views/blog/write.vue'),
    },
    {
      name: 'chat',
      path: 'chat',
      component: () => import('/@/views/chat/index.vue'),
      redirect: '/home/chat/index',
      children: [
        {
          path: 'index',
          component: () => import('/@/views/chat/components/ChatBox/index.vue'),
          name: 'chatbox',
          meta: {
            title: '在线聊天',
            keepAlive: true,
          },
        },
        {
          path: 'userInfo',
          component: () =>
            import('/@/views/chat/components/UserInfo/index.vue'),
          name: 'user',
          meta: {
            title: '用户管理器',
            keepAlive: true,
          },
        },
      ],
    },
    {
      name: 'test',
      path: 'test',
      component: () => import('/@/views/test/index.vue'),
    },
    {
      name: 'userProfile',
      path: 'user/profile',
      component: () => import('/@/views/user/profile/index.vue'),
      redirect: '/home/user/profile/dashboard',
      children: [
        {
          path: 'dashboard',
          name: 'userDashboard',
          component: () => import('/@/views/user/profile/dashboard.vue'),
          meta: {
            title: '个人中心',
            keepAlive: true,
          },
        },
        {
          path: 'articles',
          name: 'userArticles',
          component: () => import('/@/views/user/profile/articles.vue'),
          meta: {
            title: '我的文章',
            keepAlive: true,
          },
        },
        {
          path: 'diary',
          name: 'userDiary',
          component: () => import('/@/views/user/profile/diary.vue'),
          meta: {
            title: '日记',
            keepAlive: true,
          },
        },
        {
          path: 'pages',
          name: 'userPages',
          component: () => import('/@/views/user/profile/pages.vue'),
          meta: {
            title: '页面',
            keepAlive: true,
          },
        },
        {
          path: 'comments',
          name: 'userComments',
          component: () => import('/@/views/user/profile/comments.vue'),
          meta: {
            title: '评论',
            keepAlive: true,
          },
        },
        {
          path: 'settings',
          name: 'userSettings',
          component: () => import('/@/views/user/profile/settings.vue'),
          meta: {
            title: '设置',
            keepAlive: true,
          },
        },
      ],
    },
    oj,
    tool,
  ],
}

export default router
